<template>
	<view>

	</view>
</template>

<script>
	export default {
		props: {
			url: {
				type: String,
				default: ''
			}
		},
		name: "comonpay",
		data() {
			return {

			};
		},
		methods: {
			payChang(data) {
				uni.requestPayment({
					appId: data.appId,
					provider: data.provider,
					timeStamp: data.timestamp,
					nonceStr: data.nonceStr,
					package: data.package,
					signType: data.signType,
					paySign: data.paySign,
					success: (res) => {
						uni.showToast({
							title: '支付成功~',
							icon: 'success'
						})
						if (this.url) {
							this.multiRedirect(this.url)
						}
						this.$emit('payEvnet','success')
					},
					fail: (err) => {
						this.$emit('payEvnet','fail')
						uni.showToast({
							title: '支付失败',
							icon: 'error'
						})
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
